//
//  TailMapViewController.m
//  陶瓷
//
//  Created by 郭天龙 on 15/7/25.
//  Copyright (c) 2015年 王戈. All rights reserved.
//

#import "TailMapViewController.h"

@interface TailMapViewController ()//<BMKMapViewDelegate>

//@property (nonatomic, strong) BMKMapView *mapView;

@end

@implementation TailMapViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
//    
//    //百度地图创建
//    _mapView = [[BMKMapView alloc] initWithFrame:CGRectMake(0, 0, kDefaultWindowWidth, kDefaultWindowHeight)];
//    [_mapView setMapType:BMKMapTypeStandard];
//    [self.view addSubview:_mapView];
    
    
    BMKOpenTransitRouteOption *opt = [[BMKOpenTransitRouteOption alloc] init];
    opt.appScheme = @"baidumapsdk://mapsdk.baidu.com";//用于调起成功后，返回原应用
    //初始化起点节点
    BMKPlanNode* start = [[BMKPlanNode alloc]init];
    //指定起点经纬度
    CLLocationCoordinate2D coor1;
    coor1.latitude = 39.90868;
    coor1.longitude = 116.204;
    //指定起点名称
    start.name = @"西直门";
    start.pt = coor1;
    //指定起点
    opt.startPoint = start;
    
    //初始化终点节点
    BMKPlanNode* end = [[BMKPlanNode alloc]init];
    CLLocationCoordinate2D coor2;
    coor2.latitude = 39.90868;
    coor2.longitude = 116.3956;
    end.pt = coor2;
    //指定终点名称
    end.name = @"天安门";
    opt.endPoint = end;
    
    //打开地图公交路线检索
    BMKOpenErrorCode code = [BMKOpenRoute openBaiduMapTransitRoute:opt];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated
{
//    [_mapView viewWillAppear];
//    _mapView.delegate = self;
}

- (void)viewWillDisappear:(BOOL)animated
{
//    [_mapView viewWillDisappear];
//    _mapView.delegate = nil;
}

@end
